const {
    Schema,
    model
} = require('mongoose');



const ordersSchema = new Schema({
    startTime: String,
    state: {
        type: Number,
        default: 3
    },
    termination: {
        type: Number,
        default: 1
    },
    endTime: String,
    salesId: {
        type: Schema.Types.ObjectId,
        ref: "salesModel"
    },
    customersId: {
        type: Schema.Types.ObjectId,
        ref: "customersModel"
    },
    productsId: {
        type: Schema.Types.ObjectId,
        ref: "productsModel",
        
    },
}, {
    versionKey: false
});

const ordersModel = model('ordersModel', ordersSchema, 'orders');
module.exports.ordersModel = ordersModel